﻿@model CSP.Receipts.DataModel.Receipt

<h2>Neues Rezept erstellen</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Rezept</legend>

        <div class="editor-label">
            @Html.Label("categoryId", "Kategorie")
        </div>
        <div class="editor-field">
            @Html.DropDownList("categoryId", new SelectList(ViewBag.Categories, "Id", "Title"))
            @Html.ValidationMessageFor(model => model.Category)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Title, "Rezepttitel")
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.Title)
            @Html.ValidationMessageFor(model => model.Title)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PreparationTime, "Zubereitungszeit in Minuten")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PreparationTime)
            @Html.ValidationMessageFor(model => model.PreparationTime)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Url, "Link zur Seite")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Url)
            @Html.ValidationMessageFor(model => model.Url)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ReceiptText, "Anleitung")
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.ReceiptText, 10, 78, null)
            @Html.ValidationMessageFor(model => model.ReceiptText)
        </div>

        <p>
            <input type="submit" value="Rezept anlegen" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Rezeptliste anzeigen", "Index")
</div>

